import random

def generate_additive_sequence(length=10):
    # 生成前两个数字
    a = random.randint(0, 100)
    b = random.randint(0, 100)
    sequence = [a, b]

    # 生成后续数字
    while len(str(''.join(map(str, sequence)))) < length:
        next_num = sequence[-1] + sequence[-2]
        sequence.append(next_num)

    # 将数字序列转换为字符串
    return ''.join(map(str, sequence))

def generate_non_additive_sequence(length=10):
    # 生成随机数字字符串
    return ''.join(str(random.randint(0, 9)) for _ in range(length))

def generate_test_cases(num_cases=100):
    test_cases = []

    # 生成有效的加法数序列
    for _ in range(num_cases // 2):
        length = random.randint(3, 15)
        test_cases.append((generate_additive_sequence(length), True))

    # 生成无效的序列
    for _ in range(num_cases // 2):
        length = random.randint(3, 15)
        test_cases.append((generate_non_additive_sequence(length), False))

    # 添加一些特殊测试用例
    special_cases = [
        ("112358", True),    # 斐波那契序列
        ("199100199", True), # 简单的加法序列
        ("123", False),      # 太短的序列
        ("101", True),       # 包含0的序列
        ("000", True),       # 全0序列
        ("1023", False),     # 不符合加法规则的序列
    ]
    test_cases.extend(special_cases)

    # 将测试用例写入文件
    with open('input2.txt', 'w') as f:
        f.write(f"{len(test_cases)}\n")
        for num, expected in test_cases:
            f.write(f"{num}\n{expected}\n")

if __name__ == '__main__':
    generate_test_cases()
